<template>
    <div class="model-form">
        <el-page-header @back="goBack" content="详情">
        </el-page-header>
        <el-form class="viewForm" label-width="80px">
                    <el-col :span="12">
                        <el-form-item label="商品编码">
                            <div v-html="viewModel.barCode"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="商家">
                            <div v-html="viewModel.storeName"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="商品名称">
                            <div v-html="viewModel.name"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="商品主图">
                            <div v-html="viewModel.logo"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="商品缩略图">
                            <div v-html="viewModel.thumbnail"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="商品分类">
                            <div v-html="viewModel.productCatalogName"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="库存">
                            <div v-html="viewModel.stockNum"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="即时库存">
                            <div v-html="viewModel.realStock"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="价格">
                            <div v-html="viewModel.price"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="是否开启规格">
                            <div v-html="viewModel.skuEnable"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="是否必点">
                            <div v-html="viewModel.required"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="折扣">
                            <div v-html="viewModel.discount"></div>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="商品简介">
                            <div v-html="viewModel.summary"></div>
                        </el-form-item>
                    </el-col>
        </el-form>
    </div>
</template>

<script>
    import common from "@/mixins/common.js";

    export default {
        name: "product_view",
        mixins: [common],
        data() {
            return {
                viewModel: {},
                activeIndex: "1"
            }
        },
        async mounted() {
            let id = this.$route.query.id;
            let data = {};
            data.id = id;
            let res = await this.$http.form("/product/view", data);
            if (res.code === 200) {
                this.viewModel = res.data;
            }
        }
    }
</script>

<style scoped>

</style>